package com.ruoyi.prod.es;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

import java.util.Date;

/**
 * 商品对象 tb_prod
 * 
 * @author yyj
 * @date 2025-08-08
 */
@Document(indexName = "es_prod2")
@Setting(shards = 1,replicas = 1)
public class EsProd
{
    private static final long serialVersionUID = 1L;

    /** 商品ID */
    @Id
    @Field(type = FieldType.Keyword)
    private Long prodId;

    /** SPU */
    @Excel(name = "SPU")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodSpu;

    /** 商品类型;0实物商品1虚拟商品2卡密/网盘 */
    @Excel(name = "商品类型;0实物商品1虚拟商品2卡密/网盘")
    @Field(type = FieldType.Keyword)
    private Long prodKind;

    /** 商品分类 */
    @Excel(name = "商品分类")
    @Field(type = FieldType.Keyword)
    private Long prodType;

    /** 商品名称 */
    @Excel(name = "商品名称")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodName;

    /** 商品品牌 */
    @Excel(name = "商品品牌")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private Long brandId;

    /** 商品单位 */
    @Excel(name = "商品单位")
    @Field(type = FieldType.Keyword)
    private Long unitId;

    /** 商品标签 */
    @Excel(name = "商品标签")
    @Field(type = FieldType.Keyword)
    private Long tagId;

    /** 供应商 */
    @Excel(name = "供应商")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String appr;

    /** 缩略图 */
    @Excel(name = "缩略图")
    @Field(type = FieldType.Keyword,index = false)
    private String prodImage;

    @Field(type = FieldType.Date,format = {},pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String createBy;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String updateBy;
    @Field(type = FieldType.Date,format = {},pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public void setProdId(Long prodId)
    {
        this.prodId = prodId;
    }

    public Long getProdId() 
    {
        return prodId;
    }

    public void setProdSpu(String prodSpu) 
    {
        this.prodSpu = prodSpu;
    }

    public String getProdSpu() 
    {
        return prodSpu;
    }

    public void setProdKind(Long prodKind) 
    {
        this.prodKind = prodKind;
    }

    public Long getProdKind() 
    {
        return prodKind;
    }

    public void setProdType(Long prodType) 
    {
        this.prodType = prodType;
    }

    public Long getProdType() 
    {
        return prodType;
    }

    public void setProdName(String prodName) 
    {
        this.prodName = prodName;
    }

    public String getProdName() 
    {
        return prodName;
    }

    public void setBrandId(Long brandId) 
    {
        this.brandId = brandId;
    }

    public Long getBrandId() 
    {
        return brandId;
    }

    public void setUnitId(Long unitId) 
    {
        this.unitId = unitId;
    }

    public Long getUnitId() 
    {
        return unitId;
    }

    public void setTagId(Long tagId) 
    {
        this.tagId = tagId;
    }

    public Long getTagId() 
    {
        return tagId;
    }

    public void setAppr(String appr) 
    {
        this.appr = appr;
    }

    public String getAppr() 
    {
        return appr;
    }

    public void setProdImage(String prodImage) 
    {
        this.prodImage = prodImage;
    }

    public String getProdImage() 
    {
        return prodImage;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("prodId", getProdId())
            .append("prodSpu", getProdSpu())
            .append("prodKind", getProdKind())
            .append("prodType", getProdType())
            .append("prodName", getProdName())
            .append("brandId", getBrandId())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("unitId", getUnitId())
            .append("tagId", getTagId())
            .append("appr", getAppr())
            .append("prodImage", getProdImage())
            .toString();
    }
}
